<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/10/16
 * Time: 11:47
 */

namespace app\index\controller;


class BaseController
{
    //记录错误日志
    function add_errorlog($title, $content,$path='')
    {
        if($path)
        {
            $npath = C('LOG_PATH') . $path.'/' . date('y_m_d') . '.log';
            \Think\Log::write("【" . $title . "】--【" . $content . "】", "INFO", "", $npath);
        }
        else {
            \Think\Log::write("【" . $title . "】--【" . $content . "】");
        }
    }
}